'use strict';
const routeInit = require('./router/index');
const validator = require('./validator');

module.exports = (app) => {
  const { router, controller, extend } = app;

  app.once('server', (server) => {
    // 启动后执行
  });
  app.on('error', (err, ctx) => {
    // 报错执行
  });
  app.on('request', (ctx) => {
    // console.log('来请求了')
  });
  app.on('response', (ctx) => {
    //来相应执行
    // console.log("相应了啊")
  });

  // 添加自定义验证规则
  validator(app)
  
  // 路由配置
  routeInit(app)
};
